import React from 'react';
import { Form, Tooltip, Icon, Divider } from 'antd';
import { FormContent, FormHeader } from '../components';

const { Item } = Form;

const PassOld = ({ data }) => {
    const { regularHistory: historyData } = data;

    return (
        <div>
            <FormHeader title="转正申请（自评）" />
            <FormContent>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="工作描述">
                    <pre
                        style={{
                            whiteSpace: 'pre-wrap',
                            wordWrap: 'break-word'
                        }}
                    >
                        {historyData.workDesc || '-'}
                    </pre>
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="主要成就">
                    <pre
                        style={{
                            whiteSpace: 'pre-wrap',
                            wordWrap: 'break-word'
                        }}
                    >
                        {historyData.outstandingPerformance || '-'}
                    </pre>
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="需要改进的地方">
                    <pre
                        style={{
                            whiteSpace: 'pre-wrap',
                            wordWrap: 'break-word'
                        }}
                    >
                        {historyData.improve || '-'}
                    </pre>
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="对公司的建议">
                    <pre
                        style={{
                            whiteSpace: 'pre-wrap',
                            wordWrap: 'break-word'
                        }}
                    >
                        {historyData.employeeToProposal || '-'}
                    </pre>
                </Item>
            </FormContent>

            <Divider style={{ margin: '32px 0 16px', color: 'rgba(0, 0, 0, 0.08)' }} />

            <FormHeader title="转正评估（直属上级）" />

            <FormContent>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="工作技能和组织价值观">
                    <pre
                        style={{
                            whiteSpace: 'pre-wrap',
                            wordWrap: 'break-word'
                        }}
                    >
                        {historyData.superiorToWorkSkills || '-'}
                    </pre>
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="主要成就">
                    <pre
                        style={{
                            whiteSpace: 'pre-wrap',
                            wordWrap: 'break-word'
                        }}
                    >
                        {historyData.superiorToAchievement || '-'}
                    </pre>
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="需要改进的地方">
                    <pre
                        style={{
                            whiteSpace: 'pre-wrap',
                            wordWrap: 'break-word'
                        }}
                    >
                        {historyData.superiorToImprove || '-'}
                    </pre>
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="综合表现">
                    {historyData.superiorAssess || ''}
                </Item>
            </FormContent>

            <Divider style={{ margin: '32px 0 16px', color: 'rgba(0, 0, 0, 0.08)' }} />

            <FormHeader title="转正评估（ HR ）" />
            <FormContent>
                <Item
                    style={{ display: 'flex' }}
                    labelCol={{ span: 3 }}
                    label={
                        <span>
                            纪律处分&nbsp;
                            <Tooltip title="在试用期内是否有任何不当行为或纪律处分">
                                <Icon type="info-circle" />
                            </Tooltip>
                        </span>
                    }
                >
                    {historyData?.punishment === 0 ? '否' : '是'}
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="转正建议">
                    同意转正
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="当前薪资">
                    {historyData.currentSalary || '-'}
                </Item>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="调整后薪资">
                    {historyData?.adjustSalary || '-'}
                </Item>
            </FormContent>

            <Divider style={{ margin: '32px 0 16px', color: 'rgba(0, 0, 0, 0.08)' }} />

            <FormHeader title="转正评估（ 区域CEO ）" />
            <FormContent>
                <Item style={{ display: 'flex' }} labelCol={{ span: 3 }} label="意见或建议">
                    {historyData?.ceoToApproval || '-'}
                </Item>
            </FormContent>
        </div>
    );
};

export default PassOld;
